﻿/*
 * Created by SharpDevelop.
 * User: IEscarro
 * Date: 8/27/2009
 * Time: 11:52 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Collections.Generic;

namespace Miming.Model
{
	/// <summary>
	/// Description of IObserver.
	/// </summary>
	public interface IObserver
	{
		void Update(Observable o);
	}
	
	public class Observable
	{
		IList<IObserver> observers = new List<IObserver>();
		
		public virtual IList<IObserver> Observers {
			get { return observers; }
			set { observers = value; }
		}
		
		public Observable()
		{
		}
		
		public virtual void NotifyObservers()
		{
			foreach (IObserver o in observers) {
				o.Update(this);
			}
		}
	}
}
